package com.mind.adjust.service.impl;

import com.mind.system.domain.AjBasicDeduction;
import com.mind.adjust.mapper.AjBasicDeductionMapper;
import com.mind.adjust.service.AjBasicDeductionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (AjBasicDeduction)表服务实现类
 *
 * @author makejava
 * @since 2024-12-02 13:41:22
 */
@Service("basicDeductionService")
public class AjBasicDeductionServiceImpl implements AjBasicDeductionService {
    @Autowired
    private AjBasicDeductionMapper basicDeductionMapper;

    /**
     * 查询信息集合
     * 
     * @param basicDeduction 信息
     * @return 信息集合
     */
    @Override
    public List<AjBasicDeduction> selectBasicDeductionList(AjBasicDeduction basicDeduction)
    {
        return basicDeductionMapper.selectBasicDeductionList(basicDeduction);
    }

    /**
     * 通过ID查询信息
     * 
     * @param basicDeductionId ID
     * @return 角色对象信息
     */
    @Override
    public AjBasicDeduction selectBasicDeductionById(Long basicDeductionId)
    {
        return basicDeductionMapper.selectBasicDeductionById(basicDeductionId);
    }

    /**
     * 删除信息
     * 
     * @param basicDeductionId ID
     * @return 结果
     */
    @Override
    public int deleteBasicDeductionById(Long basicDeductionId)
    {
        return basicDeductionMapper.deleteBasicDeductionById(basicDeductionId);
    }

    /**
     * 批量删除信息
     * 
     * @param basicDeductionIds 需要删除的ID
     * @return 结果
     */
    @Override
    public int deleteBasicDeductionByIds(String[] basicDeductionIds)
    {
        return basicDeductionMapper.deleteBasicDeductionByIds(basicDeductionIds);
    }

    /**
     * 新增保存信息
     * 
     * @param basicDeduction 信息
     * @return 结果
     */
    @Override
    public int insertBasicDeduction(AjBasicDeduction basicDeduction)
    {
        return basicDeductionMapper.insertBasicDeduction(basicDeduction);
    }

    /**
     * 修改保存信息
     * 
     * @param basicDeduction 信息
     * @return 结果
     */
    @Override
    public int updateBasicDeduction(AjBasicDeduction basicDeduction)
    {
        return basicDeductionMapper.updateBasicDeduction(basicDeduction);
    }
    
    /**
     * 批量插入
     *
     * @param basicDeductionList 附件类型信息
     * @return 结果
     */
    @Override
    public int batchInsert(List<AjBasicDeduction> basicDeductionList) {
        int size = 0;
        for(AjBasicDeduction basicDeduction: basicDeductionList) {
//            if (basicDeductionMapper.selectBasicDeductionByName(basicDeduction.getName()) == null){
//                basicDeductionMapper.insertBasicDeduction(basicDeduction);
//                size ++;
//            }
        }
        return size;
    }
}
